const {
	Service
} = require('dx-router-admin')

module.exports = class User extends Service {
	constructor(ctx) {
		super(ctx)

		this.table = 'uni-id-users';

		this.field = {
			username: '用户名',
			password: '密码',
			nickname: '昵称',
			gender: '性别',
			status: '用户状态',
			mobile: '手机号'
		};		
	}
	//手机号码是否已注册
	async getMobileType(mobile){
		const row = await this.where('mobile',mobile).find();
		return row.hasData()?'login':'register';
	}
}
